<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Limits of Basic Types</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="index.html" title="GLib Reference Manual">
<link rel="up" href="glib-fundamentals.html" title="GLib Fundamentals">
<link rel="prev" href="glib-Basic-Types.html" title="Basic Types">
<link rel="next" href="glib-Standard-Macros.html" title="Standard Macros">
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="glib.html" title="GLib Overview">
<link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals">
<link rel="chapter" href="glib-core.html" title="GLib Core Application Support">
<link rel="chapter" href="glib-utilities.html" title="GLib Utilities">
<link rel="chapter" href="glib-data-types.html" title="GLib Data Types">
<link rel="chapter" href="tools.html" title="GLib Tools">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">
<link rel="index" href="ix09.html" title="Index of new symbols in 2.14">
<link rel="index" href="ix10.html" title="Index of new symbols in 2.16">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="glib-Basic-Types.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="glib-fundamentals.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GLib Reference Manual</th>
<td><a accesskey="n" href="glib-Standard-Macros.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2883390" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#id2883642" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="glib-Limits-of-Basic-Types"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2883390"></a><span class="refentrytitle">Limits of Basic Types</span>
</h2>
<p>Limits of Basic Types &#8212; portable method of determining the limits of the standard types</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">

#include &lt;glib.h&gt;


#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MININT:CAPS">G_MININT</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXINT:CAPS">G_MAXINT</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUINT:CAPS">G_MAXUINT</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINSHORT:CAPS">G_MINSHORT</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXSHORT:CAPS">G_MAXSHORT</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUSHORT:CAPS">G_MAXUSHORT</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINLONG:CAPS">G_MINLONG</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXLONG:CAPS">G_MAXLONG</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXULONG:CAPS">G_MAXULONG</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MININT8:CAPS">G_MININT8</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXINT8:CAPS">G_MAXINT8</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUINT8:CAPS">G_MAXUINT8</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MININT16:CAPS">G_MININT16</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXINT16:CAPS">G_MAXINT16</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUINT16:CAPS">G_MAXUINT16</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MININT32:CAPS">G_MININT32</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXINT32:CAPS">G_MAXINT32</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUINT32:CAPS">G_MAXUINT32</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MININT64:CAPS">G_MININT64</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXINT64:CAPS">G_MAXINT64</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUINT64:CAPS">G_MAXUINT64</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXSIZE:CAPS">G_MAXSIZE</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINSSIZE:CAPS">G_MINSSIZE</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXSSIZE:CAPS">G_MAXSSIZE</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINOFFSET:CAPS">G_MINOFFSET</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXOFFSET:CAPS">G_MAXOFFSET</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINFLOAT:CAPS">G_MINFLOAT</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXFLOAT:CAPS">G_MAXFLOAT</a>

#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINDOUBLE:CAPS">G_MINDOUBLE</a>
#define             <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXDOUBLE:CAPS">G_MAXDOUBLE</a>
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2883642"></a><h2>Description</h2>
<p>
These macros provide a portable method to determine the limits of some of
the standard integer and floating point types.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2883658"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2883668"></a><h3>
<a name="G-MININT:CAPS"></a>G_MININT</h3>
<a class="indexterm" name="id2883681"></a><pre class="programlisting">#define G_MININT	INT_MIN
</pre>
<p>
The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint"><span class="type">gint</span></a>.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2883704"></a><h3>
<a name="G-MAXINT:CAPS"></a>G_MAXINT</h3>
<a class="indexterm" name="id2883717"></a><pre class="programlisting">#define G_MAXINT	INT_MAX
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint"><span class="type">gint</span></a>.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2883740"></a><h3>
<a name="G-MAXUINT:CAPS"></a>G_MAXUINT</h3>
<a class="indexterm" name="id2883753"></a><pre class="programlisting">#define G_MAXUINT	UINT_MAX
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#guint"><span class="type">guint</span></a>.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2883776"></a><h3>
<a name="G-MINSHORT:CAPS"></a>G_MINSHORT</h3>
<a class="indexterm" name="id2883789"></a><pre class="programlisting">#define G_MINSHORT	SHRT_MIN
</pre>
<p>
The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gshort"><span class="type">gshort</span></a>.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2883812"></a><h3>
<a name="G-MAXSHORT:CAPS"></a>G_MAXSHORT</h3>
<a class="indexterm" name="id2883825"></a><pre class="programlisting">#define G_MAXSHORT	SHRT_MAX
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gshort"><span class="type">gshort</span></a>.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2883848"></a><h3>
<a name="G-MAXUSHORT:CAPS"></a>G_MAXUSHORT</h3>
<a class="indexterm" name="id2883861"></a><pre class="programlisting">#define G_MAXUSHORT	USHRT_MAX
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gushort"><span class="type">gushort</span></a>.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2883885"></a><h3>
<a name="G-MINLONG:CAPS"></a>G_MINLONG</h3>
<a class="indexterm" name="id2883897"></a><pre class="programlisting">#define G_MINLONG	LONG_MIN
</pre>
<p>
The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#glong"><span class="type">glong</span></a>.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2883921"></a><h3>
<a name="G-MAXLONG:CAPS"></a>G_MAXLONG</h3>
<a class="indexterm" name="id2883933"></a><pre class="programlisting">#define G_MAXLONG	LONG_MAX
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#glong"><span class="type">glong</span></a>.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2883956"></a><h3>
<a name="G-MAXULONG:CAPS"></a>G_MAXULONG</h3>
<a class="indexterm" name="id2883969"></a><pre class="programlisting">#define G_MAXULONG	ULONG_MAX
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gulong"><span class="type">gulong</span></a>.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2883992"></a><h3>
<a name="G-MININT8:CAPS"></a>G_MININT8</h3>
<a class="indexterm" name="id2884007"></a><pre class="programlisting">#define G_MININT8	((gint8)  0x80)
</pre>
<p>
The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint8"><span class="type">gint8</span></a>.
</p>
<p class="since">Since 2.4


</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884038"></a><h3>
<a name="G-MAXINT8:CAPS"></a>G_MAXINT8</h3>
<a class="indexterm" name="id2884052"></a><pre class="programlisting">#define G_MAXINT8	((gint8)  0x7f)
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint8"><span class="type">gint8</span></a>.
</p>
<p class="since">Since 2.4


</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884083"></a><h3>
<a name="G-MAXUINT8:CAPS"></a>G_MAXUINT8</h3>
<a class="indexterm" name="id2884098"></a><pre class="programlisting">#define G_MAXUINT8	((guint8) 0xff)
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#guint8"><span class="type">guint8</span></a>.
</p>
<p class="since">Since 2.4


</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884128"></a><h3>
<a name="G-MININT16:CAPS"></a>G_MININT16</h3>
<a class="indexterm" name="id2884143"></a><pre class="programlisting">#define G_MININT16	((gint16)  0x8000)
</pre>
<p>
The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint16"><span class="type">gint16</span></a>.
</p>
<p class="since">Since 2.4


</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884173"></a><h3>
<a name="G-MAXINT16:CAPS"></a>G_MAXINT16</h3>
<a class="indexterm" name="id2884188"></a><pre class="programlisting">#define G_MAXINT16	((gint16)  0x7fff)
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint16"><span class="type">gint16</span></a>.
</p>
<p class="since">Since 2.4


</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884218"></a><h3>
<a name="G-MAXUINT16:CAPS"></a>G_MAXUINT16</h3>
<a class="indexterm" name="id2884234"></a><pre class="programlisting">#define G_MAXUINT16	((guint16) 0xffff)
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#guint16"><span class="type">guint16</span></a>.
</p>
<p class="since">Since 2.4


</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884264"></a><h3>
<a name="G-MININT32:CAPS"></a>G_MININT32</h3>
<a class="indexterm" name="id2884279"></a><pre class="programlisting">#define G_MININT32	((gint32)  0x80000000)
</pre>
<p>
The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint32"><span class="type">gint32</span></a>.
</p>
<p class="since">Since 2.4


</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884309"></a><h3>
<a name="G-MAXINT32:CAPS"></a>G_MAXINT32</h3>
<a class="indexterm" name="id2884324"></a><pre class="programlisting">#define G_MAXINT32	((gint32)  0x7fffffff)
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint32"><span class="type">gint32</span></a>.
</p>
<p class="since">Since 2.4


</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884354"></a><h3>
<a name="G-MAXUINT32:CAPS"></a>G_MAXUINT32</h3>
<a class="indexterm" name="id2884369"></a><pre class="programlisting">#define G_MAXUINT32	((guint32) 0xffffffff)
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#guint32"><span class="type">guint32</span></a>.
</p>
<p class="since">Since 2.4


</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884399"></a><h3>
<a name="G-MININT64:CAPS"></a>G_MININT64</h3>
<a class="indexterm" name="id2884412"></a><pre class="programlisting">#define G_MININT64	((gint64) G_GINT64_CONSTANT(0x8000000000000000))
</pre>
<p>
The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint64"><span class="type">gint64</span></a>.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884436"></a><h3>
<a name="G-MAXINT64:CAPS"></a>G_MAXINT64</h3>
<a class="indexterm" name="id2884449"></a><pre class="programlisting">#define G_MAXINT64	G_GINT64_CONSTANT(0x7fffffffffffffff)
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint64"><span class="type">gint64</span></a>.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884472"></a><h3>
<a name="G-MAXUINT64:CAPS"></a>G_MAXUINT64</h3>
<a class="indexterm" name="id2884485"></a><pre class="programlisting">#define G_MAXUINT64	G_GINT64_CONSTANT(0xffffffffffffffffU)
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#guint64"><span class="type">guint64</span></a>.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884509"></a><h3>
<a name="G-MAXSIZE:CAPS"></a>G_MAXSIZE</h3>
<a class="indexterm" name="id2884524"></a><pre class="programlisting">#define G_MAXSIZE	G_MAXUINT
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gsize"><span class="type">gsize</span></a>.
</p>
<p class="since">Since 2.4


</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884554"></a><h3>
<a name="G-MINSSIZE:CAPS"></a>G_MINSSIZE</h3>
<a class="indexterm" name="id2884569"></a><pre class="programlisting">#define G_MINSSIZE	G_MININT
</pre>
<p>
The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gssize"><span class="type">gssize</span></a>.
</p>
<p class="since">Since 2.14


</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884599"></a><h3>
<a name="G-MAXSSIZE:CAPS"></a>G_MAXSSIZE</h3>
<a class="indexterm" name="id2884614"></a><pre class="programlisting">#define G_MAXSSIZE	G_MAXINT
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gssize"><span class="type">gssize</span></a>.
</p>
<p class="since">Since 2.14


</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884645"></a><h3>
<a name="G-MINOFFSET:CAPS"></a>G_MINOFFSET</h3>
<a class="indexterm" name="id2884658"></a><pre class="programlisting">#define G_MINOFFSET	G_MININT64
</pre>
<p>
The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#goffset"><span class="type">goffset</span></a>.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884681"></a><h3>
<a name="G-MAXOFFSET:CAPS"></a>G_MAXOFFSET</h3>
<a class="indexterm" name="id2884694"></a><pre class="programlisting">#define G_MAXOFFSET	G_MAXINT64
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#goffset"><span class="type">goffset</span></a>.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884717"></a><h3>
<a name="G-MINFLOAT:CAPS"></a>G_MINFLOAT</h3>
<a class="indexterm" name="id2884730"></a><pre class="programlisting">#define G_MINFLOAT	FLT_MIN
</pre>
<p>
The minimum positive value which can be held in a <a class="link" href="glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a>.
</p>
<p>
If you are interested in the smallest value which can be held in a <a class="link" href="glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a>,
use -G_MAX_FLOAT.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884766"></a><h3>
<a name="G-MAXFLOAT:CAPS"></a>G_MAXFLOAT</h3>
<a class="indexterm" name="id2884779"></a><pre class="programlisting">#define G_MAXFLOAT	FLT_MAX
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a>.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884802"></a><h3>
<a name="G-MINDOUBLE:CAPS"></a>G_MINDOUBLE</h3>
<a class="indexterm" name="id2884815"></a><pre class="programlisting">#define G_MINDOUBLE	DBL_MIN
</pre>
<p>
The minimum positive value which can be held in a <a class="link" href="glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a>.
</p>
<p>
If you are interested in the smallest value which can be held in a <a class="link" href="glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a>,
use -G_MAXDOUBLE.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2884851"></a><h3>
<a name="G-MAXDOUBLE:CAPS"></a>G_MAXDOUBLE</h3>
<a class="indexterm" name="id2884864"></a><pre class="programlisting">#define G_MAXDOUBLE	DBL_MAX
</pre>
<p>
The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a>.
</p>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id2884889"></a><div class="refsect2" lang="en"><a name="id2884890"></a></div>
<hr>
<div class="refsect2" lang="en"><a name="id2884891"></a></div>
</div>
</div>
</body>
</html>
